# coding:utf-8
import threading

import redis
import time

conn = redis.Redis(host='192.168.3.25')

def trans():
    pipeline = conn.pipeline()
    pipeline.incr('trans:')
    time.sleep(.1)
    pipeline.incr('trans:', -1)
    print pipeline.execute()[0]


if __name__ == '__main__':
    for i in xrange(3):
        threading.Thread(target=trans).start()
    time.sleep(.5)

